CREATE TABLE [dbo].[DnnProduct_CDS_Assets]
(
[ID] [int] NOT NULL IDENTITY(1, 1) NOT FOR REPLICATION,
[TemplateID] [int] NULL,
[ResourceID] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DistributorID] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Identifier] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Active] [bit] NULL CONSTRAINT [DF_DnnProduct_CDS_Assets_Active] DEFAULT ((1)),
[Title] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Format] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Creator] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Publisher] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Link] [nvarchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LinkType] [tinyint] NULL,
[DRMType] [tinyint] NULL,
[PackageStatus] [tinyint] NOT NULL,
[Packaged] [bit] NULL,
[MaxDownloads] [int] NULL,
[FileSize] [bigint] NULL,
[ModificationDate] [datetime] NULL,
[SKU] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ListPrice] [decimal] (18, 2) NULL,
[Archived] [bit] NOT NULL CONSTRAINT [DF__DnnProduc__Archi__33208881] DEFAULT ((0)),
[CategoryID] [int] NULL,
[Notes] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_CDS_Assets] ADD CONSTRAINT [PK_DnnProduct_CDS_Assets] PRIMARY KEY CLUSTERED  ([ID]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_CDS_Assets] ADD CONSTRAINT [IX_DnnProduct_CDS_Assets_Unique_Identifier] UNIQUE NONCLUSTERED  ([Identifier], [DistributorID]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_DnnProduct_CDS_Assets_CategoryID] ON [dbo].[DnnProduct_CDS_Assets] ([CategoryID]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_CDS_Assets] WITH NOCHECK ADD CONSTRAINT [FK_DnnProduct_CDS_Assets_DnnProduct_CDS_Categories] FOREIGN KEY ([CategoryID]) REFERENCES [dbo].[DnnProduct_CDS_Categories] ([ID]) NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[DnnProduct_CDS_Assets] WITH NOCHECK ADD CONSTRAINT [FK_DnnProduct_CDS_Assets_DnnProduct_CDS_Templates] FOREIGN KEY ([TemplateID]) REFERENCES [dbo].[DnnProduct_CDS_Templates] ([ID]) NOT FOR REPLICATION
GO
